const MyPromise = require("./myPromise02");

function timeOut(name) {
  return new MyPromise((resolve, reject) => {
    // resolve(name + "成功了");
     reject(`${name}失败了`)
  });
  // return MyPromise.reject(`${name}失败了`);
}

timeOut("mashaodong")
  .then(
    (res) => {
      console.log(res);
      return new MyPromise((resolve) => {
        resolve("成功了");
      });
    },
    (err) => {
      console.log(err);
    }
  )
  .then((res) => {
    console.log(res);
  });
// .catch((err) => {
//   console.log(err);
// });
